Using bind( type, [data], fn ) and non-inline function

Posted by dalizard on Stack Overflow See other posts from Stack Overflow or by dalizard
Published on 2009-05-13T17:43:48Z Indexed on 2010/05/28 0:01 UTC
Read the original article Hit count: 152

Filed under:
$("p").bind("click", function(event){
       // code goes here
});

This is quite understandable. But what is the way to use a non-inline function and pass the event as an argument? That is:

$("p").bind("click", myFunction(event));

 function myFunction(event) {
       // code goes here
 }

Thank you!

© Stack Overflow or respective owner

Related posts about jQuery